package cz.moglum.bloodb.server;

import java.util.List;

import cz.moglum.bloodb.client.RPCObjectFactoryService;
import cz.moglum.bloodb.client.objects.BaseObject;
import cz.moglum.bloodb.client.objects.PlayerObject;
import cz.moglum.bloodb.client.objects.TeamObject;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class RPCObjectFactoryServiceImpl extends RemoteServiceServlet implements
		RPCObjectFactoryService {

	// ?
	private static final long serialVersionUID = -6655934285004174687L;

	public List<BaseObject> getAll(String type) {
		// TODO Auto-generated method stub
		List<BaseObject> result = null;
		return result;
	}

	public BaseObject getById(String type, String id) {
		BaseObject result = null;

		// TODO temporary
		if (type.equals("Team")) {
			result = (BaseObject) new TeamObject(id);
		}
		if (type.equals("Player")){
			result = (BaseObject) new PlayerObject(id);
		}
		return result;
	}
}
